#!/usr/bin/env python
#  -*- coding: utf-8 -*-
__author__ = 'yinq'

# f = open("yesterday.txt", 'r', encoding="utf-8")  # 文件句柄
# f = open("yesterday.txt", 'r+', encoding="utf-8")  # 文件句柄 读写
# f = open("yesterday.txt", 'w+', encoding="utf-8")  # 文件句柄 写读
# f = open("yesterday.txt", 'a+', encoding="utf-8")  # 文件句柄 追加读写
f = open("yesterday2.txt", 'wb')  # 文件句柄 二进制文件
f.write("hello,binary\n".encode())
f.close()

'''
data = f.read()
data2 = f.read()
print(data)
print("----data2---", data2)
f.write("我爱Python！！")
'''

'''
#high bige  读一行，删一行，内存只保存一行
count=0
for line in f:
    if count == 9:
        print("------我是分割线------")
        count += 1
        continue
    print(line.strip())
    count +=1
# low loop

for index,line in enumerate(f.readlines()):
    if index == 9:
        print("------我是分割线------")
        continue
    print(line.strip())
'''
